#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define debug(x) cout << #x << " = " << x << '\n'
#define INF 0x3f3f3f3f
using namespace std;

#define N 100010

int n, res, l, r;
int a[N], sum;

signed main()
{
    int t;
    cin >> t;
    for (int k = 1; k <= t; k++)
    {
        sum = 0, res = -1e10, l = 0, r = 0;
        cin >> n;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        int tl = 1, tr = 0;
        while (tr <= n)
        {
            if (sum + a[tr + 1] >= a[tr + 1])
            {
                sum += a[tr + 1];
                tr++;
            }
            else
            {
                sum = a[tr + 1];
                tl = tr + 1, tr++;
            }
            if (res <= sum)
            {
                l = tl, r = tr;
                res = sum;
            }
        }
        printf("Case %d: %d %d %d\n", k, res, l, r);
    }
    return 0;
}